package com.yby.dome10;

/**
 * 乐手类
 */
public class Musician {
    //乐手根据弹奏不同的乐器从而发出不同的声音
    public void play(Instrument instrument){
        if (instrument instanceof Erhu){
            Erhu erhu = (Erhu) instrument;

        }
        if (instrument instanceof Piano){
            Piano piano = (Piano) instrument;
        }
        if (instrument instanceof Violin){
            Violin violin = (Violin) instrument;
        }
    }
}
